package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.service.IUserViewService;
import cn.wolfcode.wolf2w.util.JsonResult;
import cn.wolfcode.wolf2w.vo.UserViewVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/userviews")
public class UserViewController {
    @Autowired
    private IUserViewService userViewService;

    @GetMapping("/getView")
    public Object getView(String ownerId, String uid){
        HashMap<Object, Object> map = new HashMap<>();
        UserViewVo userViewVo = userViewService.find(ownerId, uid);

        return JsonResult.success(userViewVo);
    }
}
